const cache = {
  namespaced: true,
  state: {
    queryDict: true,
    cacheData: {}
  },
  mutations: {
    setQueryDict (state, info) {
      state.queryDict = info
    },
    setCacheData(state,data){
      state.cacheData[data.key] = data.value;
    },
    removeCacheData(state,key){
      delete state.cacheData[key];
    }
  },
  actions : {
    setCacheData({ commit } ,data){
      commit('setCacheData', data);
    },
    removeCacheData({ commit } , key){
      commit('removeCacheData', key);
    }
  }
}

export default cache
